package com.zth.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.PageHelper;
import com.zth.mapper.CategoryMapper;
import com.zth.pojo.Category;
import com.zth.service.CategoryService;

@Service
@Transactional
public class CategoryServiceImpl implements CategoryService{

	@Autowired
	private CategoryMapper categoryMapper;
	
	@Override
	public List<Category> CategoryAll(int page,int pageSize) {
		PageHelper.startPage(page,pageSize);
		return categoryMapper.CategoryAll();
	}

	@Override
	public Category findByName(String blog_category_name) {
		return categoryMapper.findByName(blog_category_name);
	}

	@Override
	public Category findById(int category_id) {
		return categoryMapper.findById(category_id);
	}

	@Override
	public int add(Category category) {
		return categoryMapper.add(category);
	}

	@Override
	public int edit(Category category) {
		return categoryMapper.edit(category);
	}

	@Override
	public int deleteBatch(int[] ids) {
		return categoryMapper.deleteBatch(ids);
	}
	
	
	
	
}
